namespace Vin.Extension.Framework.AntChain.Models.Req;

public class OrderPromiseReq
{
    /// <summary>
    /// overdueDay 宽限期 gracePeriodDays时 penaltyFeeMoney必须为0
    /// totalMoney = rentalMoney+penaltyFeeMoney
    /// </summary>
    public class PenaltyFeeStrategyModel
    {
        /// <summary>
        /// 超期天数 1：表示超出1天 2: 表示2天
        /// </summary>
        public long OverdueDay { get; set; }
        
        /// <summary>
        /// 实际扣款总金额，单位为分 1234表示12.34元 大于0
        /// </summary>
        public long TotalMoney { get; set; }
        
        /// <summary>
        /// 租金，单位为分 1234表示12.34元 大于0
        /// </summary>
        public long RentalMoney { get; set; }
        
        /// <summary>
        /// 罚款金额，单位为分 1234表示12.34元 大于0
        /// </summary>
        public long PenaltyFeeMoney { get; set; }
    }
    
    public class OperateDivideTransInModel
    {
        /// <summary>
        /// 分账收入方支付宝用户id, 支付宝2088id
        /// </summary>
        public string? TransInUserId { get; set; }
        
        /// <summary>
        /// 分账金额，单位为分 大于0
        /// </summary>
        public long? DivideAmount { get; set; }
        
        /// <summary>
        /// 分账描述 长度小于64
        /// </summary>
        public string? Desc { get; set; }
    }
    
    /// <summary>
    /// payDay校验规则：
    /// 当punishmentType=NONE(没有罚息), payDay可以设置为当日
    /// punishmentType为其他情况，payDay必须大于当前日期，即从第二日开始
    /// 两个payDay之间的间隔天数需大于27天
    /// </summary>
    public class RepayStrategy
    {
        /// <summary>
        /// 应付租金时间，精确到天 格式为yyyy-MM-dd 2019-08-31
        /// </summary>
        public string? PayDay { get; set; }
        
        /// <summary>
        /// 用户还款期数，从1开始
        /// </summary>
        public long? TermIndex { get; set; }
        
        /// <summary>
        /// 应付租金，精确到分，即1234表示12.34元  punishmentType=NONE, 按照本数值进行扣款  大于0
        /// </summary>
        public long? RentalMoney { get; set; }
        
        /// <summary>
        /// 处罚策略列表 punishmentType=PENALTY_FEE必填
        /// </summary>
        public List<PenaltyFeeStrategyModel>? PenaltyFeeStrategyList { get; set; }
        
        /// <summary>
        /// 是否经营分账, Y-是、N-否 为空代表否
        /// </summary>
        public string? OperateDivideFlag { get; set; }
        
        /// <summary>
        /// 经营分账收入方列表
        /// 分账金额总计需要小于应付租金的30%
        /// 分账列表最多10个
        /// 分账用户不可以重复
        /// operateDivideFlag=N,禁止传入
        /// </summary>
        public List<OperateDivideTransInModel>? OperateDivideTransInList { get; set; }
    }
    
    /// <summary>
    /// 宽限期，天
    /// </summary>
    public long? GracePeriodDays { get; set; }
    
    /// <summary>
    /// 罚息类型 NONE : 没有罚息，PENALTY_FEE： 罚息 (暂不支持）
    /// </summary>
    public string? PunishmentType { get; set; }
    
    /// <summary>
    /// 租期
    /// </summary>
    public long? PayPeriod { get; set; }

    /// <summary>
    /// 租赁公司支付宝UID 长度小于50
    /// </summary>
    public string? LeaseAlipayUid { get; set; }
    
    /// <summary>
    /// 还款策略  repayStrategyList长度 == payPeriod
    /// </summary>
    public List<RepayStrategy>? RepayStrategyList { get; set; }
}